#pragma once
#include <memory>
#include <string>
#include <cstddef>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <odb/nullable.hxx>
#include <odb/core.hxx>


namespace entity {

#pragma db object table("user_relation")
class UserRelation
{
public:
    UserRelation() {}
    UserRelation(const std::string& userId1, const std::string& userId2)
        : userId1_(userId1), userId2_(userId2) {}

    void setUserId1(const std::string& val) { userId1_ = val; }
    std::string userId1() { return userId1_; }

    void setUserId2(const std::string& val) { userId2_ = val; }
    std::string userId2() { return userId2_; }

private:
    friend class odb::access; 
    
    #pragma db id auto
    uint32_t id_;

    #pragma db column("user_id_1") type("varchar(32)") index 
    std::string userId1_;

    #pragma db column("user_id_2") type("varchar(32)")
    std::string userId2_;
};

using UserRelationPtr = std::shared_ptr<UserRelation>;

}

// odb -d mysql --std c++11 --generate-query --generate-schema --profile boost/date-time user_relation.hxx
